﻿//AcademicPlanner - course registration planning web app.
//Copyright (C) 2009  Boubacar Diallo

//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.


using System;
using AcademicPlanner.Presentation.Views.Shared;

namespace AcademicPlanner.Presentation.Views.Site
{
	/// <summary>
	/// Represents the home page of the AcademicPlanner application.
	/// This view embedds a <c>AccountForm</c> for login and <c>PersonForm</c>
	/// for registration and account recovery.
	/// </summary>
	/// <since>1.0</since>
    public partial class Home : View<object>
    {
		/// <summary>
		/// Gets or sets the model for the <c>AccountForm</c> embedded in this
		/// view with a <c>LOGIN</c> scenario.
		/// </summary>
		/// <since>1.0</since>
		public AccountFormModel LoginAccountModel { get; set; }

		/// <summary>
		/// Gets or sets the model object for the <c>PersonForm</c> embedded in this
		/// view with a <c>FORGOT_PASSWORD</c> scenario.
		/// </summary>
		/// <since>1.0</since>
		public PersonFormModel ForgotPasswordModel { get; set; }


		/// <summary>
		/// Handles the load page event by setting the page's heading and title.
		/// </summary>
		/// <remarks>
		/// This method initializes the model objects for this view's
		/// embedded forms.
		/// </remarks>
		/// <param name="sender">The sender of the event.</param>
		/// <param name="e">The information about the event</param>
		/// <since>1.0</since>
		protected void Page_Load(object sender, EventArgs e)
		{
			pageHeading = Tr("Welcome");
			Title = string.Format(Tr(titleFormat), pageHeading);
			pageTip = App_LocalResources.PageTips.Home;

			LoginAccountModel = new AccountFormModel();
			LoginAccountModel.Scenario = AccountFormScenario.LOGIN;

			ForgotPasswordModel = new PersonFormModel();
			ForgotPasswordModel.Scenario = PersonFormScenario.FORGOT_PASSWORD;
		}
    }
}
